<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Oauth_model extends CI_Model {
	
	function __construct(){
        parent::__construct();
    }
    
	
    function add($parms = array()){
		$this->db->insert('zjy_oauth', $parms);
	    return $this->db->affected_rows();
    }
	
 	function update_oauth($parms = array()){
    	$this->db->where('id', $parms['id']);
		$this->db->update('zjy_oauth', $parms);
		$res = $this->db->affected_rows();
		return $res;
    }
    
	function get_one($where = array(),$select='*'){
		$this->db->select($select);
		if($where){
			$this->db->where($where);
		}
		$this->db->limit(1);
		$query = $this->db->get('zjy_oauth');
		return $query->row_array();
	}
    
}